getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Mon, 7 Sep 2020 16:47:28 +0000 (17:47 +0100)
committerRyan Tandy <ryan@nardis.ca>
Mon, 7 Sep 2020 16:47:28 +0000 (17:47 +0100)
commitc0677f2391b5c5ef035b61a33eadb48d09ed4517
treeea7595140600a80e0c79f02367135b63d8e8ff08
parent8f3683cccd80cf560e35136f6aac00728a060c0d
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c